package grape.workflow.rest.client.process;

import org.flowable.rest.service.api.runtime.process.ProcessInstanceCollectionResource;
import org.flowable.rest.service.api.runtime.process.ProcessInstanceCreateRequest;
import org.flowable.rest.service.api.runtime.process.ProcessInstanceResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * Created by yangwei
 * Created at 2020/6/15 16:14
 */
@Component
@FeignClient(value = "grape-workflow")
public interface ProcessClient {
    /**
     * 启动流程
     * @see ProcessInstanceCollectionResource#createProcessInstance(org.flowable.rest.service.api.runtime.process.ProcessInstanceCreateRequest, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     * @param request
     * @return
     */
    @PostMapping(value = "/process-api/runtime/process-instances")
    public ProcessInstanceResponse createProcessInstance(@RequestBody ProcessInstanceCreateRequest request);
}
